VOID:OBJECT,UINT
VOID:OBJECT,UINT,FLAGS
VOID:OBJECT,STRING
+VOID:OBJECT,OBJECT,OBJECT
VOID:POINTER
VOID:POINTER,INT
VOID:POINTER,BOOLEAN
}
+static void
+printer_changed_cb (GtkPrintUnixDialog *print_dialog,
+ GParamSpec *pspec,
+ gpointer user_data)
+{
+ GtkPageSetup *page_setup;
+ GtkPrintSettings *print_settings;
+ GtkPrintOperation *op = user_data;
+ GtkPrintOperationPrivate *priv = op->priv;
+
+ page_setup = gtk_print_unix_dialog_get_page_setup (print_dialog);
+ print_settings = gtk_print_unix_dialog_get_settings (print_dialog);
+
+ g_signal_emit_by_name (op,
+ "update-custom-widget",
+ priv->custom_widget,
+ page_setup,
+ print_settings);
+}
+
static GtkWidget *
get_print_dialog (GtkPrintOperation *op,
GtkWindow *parent)
gtk_print_unix_dialog_add_custom_tab (GTK_PRINT_UNIX_DIALOG (pd),
priv->custom_widget, label);
+
+ g_signal_connect (pd, "notify::selected-printer", (GCallback) printer_changed_cb, op);
}
return pd;
CREATE_CUSTOM_WIDGET,
CUSTOM_WIDGET_APPLY,
PREVIEW,
+ UPDATE_CUSTOM_WIDGET,
LAST_SIGNAL
};
_gtk_marshal_OBJECT__VOID,
G_TYPE_OBJECT, 0);
+ /**
+ * GtkPrintOperation::update-custom-widget:
+ * @operation: the #GtkPrintOperation on which the signal was emitted
+ * @widget: the custom widget added in create-custom-widget
+ * @setup: actual page setup
+ * @settings: actual print settings
+ *
+ * Emmited after change of selected printer. The actual page setup and
+ * print settings are passed to the custom widget, which can actualize
+ * itself according to this change.
+ *
+ * Since: 2.18
+ */
+ signals[UPDATE_CUSTOM_WIDGET] =
+ g_signal_new (I_("update-custom-widget"),
+ G_TYPE_FROM_CLASS (class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GtkPrintOperationClass, update_custom_widget),
+ NULL, NULL,
+ _gtk_marshal_VOID__OBJECT_OBJECT_OBJECT,
+ G_TYPE_NONE, 3, GTK_TYPE_WIDGET, GTK_TYPE_PAGE_SETUP, GTK_TYPE_PRINT_SETTINGS);
+
/**
* GtkPrintOperation::custom-widget-apply:
* @operation: the #GtkPrintOperation on which the signal was emitted
* @widget: the custom widget added in create-custom-widget
*
* Emitted right before #GtkPrintOperation::begin-print if you added
- * a custom widget in the #GtkPrintOperation:;create-custom-widget handler.
+ * a custom widget in the #GtkPrintOperation::create-custom-widget handler.
* When you get this signal you should read the information from the
* custom widgets, as the widgets are not guaraneed to be around at a
* later time.
GtkWidget *(*create_custom_widget) (GtkPrintOperation *operation);
void (*custom_widget_apply) (GtkPrintOperation *operation,
- GtkWidget *widget);
+ GtkWidget *widget);
gboolean (*preview) (GtkPrintOperation *operation,
GtkPrintOperationPreview *preview,
GtkPrintContext *context,
GtkWindow *parent);
+ void (*update_custom_widget) (GtkPrintOperation *operation,
+ GtkWidget *widget,
+ GtkPageSetup *setup,
+ GtkPrintSettings *settings);
+
/* Padding for future expansion */
void (*_gtk_reserved1) (void);
void (*_gtk_reserved2) (void);
void (*_gtk_reserved4) (void);
void (*_gtk_reserved5) (void);
void (*_gtk_reserved6) (void);
- void (*_gtk_reserved7) (void);
};
#define GTK_PRINT_ERROR gtk_print_error_quark ()
update_dialog_from_settings (dialog);
update_dialog_from_capabilities (dialog);
+
+ g_object_notify ( G_OBJECT(dialog), "selected-printer");
}
static void